package com.me.mvc.model.entity;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

/**
 * @author Roman Uholnikov
 */
@Entity
@Table(name = "tbl_clients")
public class EnergoClient {

    @Id
    int id;

    @Column(name = "short_name")
    String shortName;

    @Column(name = "fullname")
    String fullName;

    double commission;

    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
//    @JoinColumn(name = "id")
    @PrimaryKeyJoinColumn
    @Column(name = "group_id")
    Set<EnergoGroup> energoGroup;

}
